Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3844 : handle gid/uid in user management #166

Conversation

VinceMacBuche
Copy link
Member

"/usr/sbin/useradd"
args => "-m ${nameopt[${usergroup_user_index}]} -s ${usergroup_user_shell[${usergroup_user_index}]} ${usergroup_user_login[${usergroup_user_index}]}",
classes => cf2_if_else("usermanagement_login_add_${usergroup_user_index}_repaired", "usermanagement_login_add_${usergroup_user_index}_error"),
comment => "Create the user",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained in https://www.rudder-project.org/foswiki/Development/TechniqueBestPractices:

Attribute's arrows '=>' should all be at the same level, one character after the largest attribute name

@nperron
Copy link
Contributor

nperron commented Aug 16, 2013

in my opinion, this Technique should stop using useradd which is a binary but only our Product Owner could say about that.
The use of useradd lead to a bug which is that a User with a GID/UID changed will not be updated.It will be don only at creation.

"any" usebundle => force_create_user_homedir("${usergroup_user_home[${usergroup_user_index}]}", "${usergroup_user_uid[${usergroup_user_index}]}", "${usergroup_user_gid[${usergroup_user_index}]}"),
ifvarclass => "usermanagement_user_forcelocal_${usergroup_user_index}.usermanagement_user_pershome_${usergroup_user_index}";

"any" usebundle => force_create_user_homedir("/home/${usergroup_user_login[${usergroup_user_index}]}", "${usergroup_user_uid[${usergroup_user_index}]}", "${usergroup_user_gid[${usergroup_user_index}]}"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, the home will be created with the GID defined in the Webapp even if this box *Set user default group ID ?: * is unticked.

@nperron
Copy link
Contributor

nperron commented Aug 16, 2013

This is a good Pull Request from our Community. The new features seems great to me but we really need a functionnal review from our Product Owner.

# UID handling
## Is OK (Success)
"@@userGroupManagement@@result_success@@${usergroup_directive_id[${usergroup_user_index}]}@@User ID@@${usergroup_user_login[${usergroup_user_index}]}@@${g.execRun}##${g.uuid}@#The user ${usergroup_user_login[${usergroup_user_index}]} ( ${repname[${usergroup_user_index}]} ) UID is OK"
ifvarclass => "usermanagement_user_uid_${usergroup_user_index}_kept";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should prevent from having several reports containing Error + Repaired + Kept by the use of:

ifvarclass => "usermanagement_user_uid_${usergroup_user_index}_kept.!(usermanagement_user_uid_${usergroup_user_index}_error|usermanagement_user_uid_${usergroup_user_index}_repaired)"; 

@nperron
Copy link
Contributor

nperron commented Aug 21, 2013

At use, it seems to work but I don't know if adduser should continue to be used.

amousset pushed a commit to amousset/rudder-techniques that referenced this pull request Dec 8, 2015
…x_policy_xml_to_metadata_conversion_failure

Fixes #4088: Fix policy.xml to metada.xml conversion failure in case of ...
@ncharles
Copy link
Member

Closing this PR, as the code changed too much. Will be superceded

@ncharles ncharles closed this Jun 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants